package cn.tannn.cat.file.sdk.config;


import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

/**
 * 七牛
 *
 * @author tnnn
 * @version V1.0
 * @date 2022-05-04 19:09
 */
@Getter
@Setter
@ToString
public class Aws3Config {

    /**
     * 文件浏览地址:  https://sda.xx.com
     * 注意最后不要有斜杠
     */
    private String browseUrl;

    /**
     * Access key就像用户ID，可以唯一标识你的账户(密钥名称)
     * 为空默认 使用 s3.credentialsProvider(DefaultCredentialsProvider.create());
     * <a href="https://docs.aws.amazon.com/zh_cn/sdk-for-java/latest/developer-guide/credentials-chain.html">...</a>
     */
    private String accessKey;

    /**
     * Secret key是你账户的密码。
     * 为空默认 使用 s3.credentialsProvider(DefaultCredentialsProvider.create());
     * <a href="https://docs.aws.amazon.com/zh_cn/sdk-for-java/latest/developer-guide/credentials-chain.html">...</a>
     */
    private String secretKey;

    /**
     * 配置自己空间所在的区域：
     * 默认："us-east-1"
     * @see software.amazon.awssdk.regions.Region
     * @see <a href="https://docs.aws.amazon.com/zh_cn/AWSEC2/latest/UserGuide/using-regions-availability-zones.html#concepts-regions">Region</a>
     */
    private String regionId;



    public String getRegionId() {
        if(regionId == null || regionId.length() == 0) {
            return "us-east-1";
        }
        return regionId;
    }


}
